<?php
/**
{
    "studentId": "INT //学生id",
    "studentName": "VARCHAR //姓名",
    "studentImg": "VARCHAR //学生头像@image; ",
    "sex": "TINYINT //性别@status; 0::保密; 1::男; 2::女",
    "birthday": "DATE //生日",
    "gradeId": "INT //年级@foreign::tbl_grade; ",
    "school": "VARCHAR //学校",
    "ip": "VARCHAR //ip@noload; @hide",
    "created": "DATETIME //创建时间",
    "uid": "INT //用户@foreign::tbl_user; "
}
 */

class Student extends Base
{
    
	private $studentId= '';//学生id
	private $studentName= NULL;//姓名
	private $studentImg= NULL;//学生头像@image;
	private $sex= "0";//性别@status;0::保密;1::男;2::女
	private $birthday= NULL;//生日
	private $gradeId= "0";//年级@foreign::tbl_grade;
	private $school= NULL;//学校
	private $ip= NULL;//ip@noload;@hide
	private $created= 'CURRENT_TIMESTAMP';//创建时间
	private $uid= "0";//用户@foreign::tbl_user;

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_student';
    }
    
    public  function key(){
        return 'studentId';
    }


    
    public static  function hideField()
    {
        return array (  0 => 'ip',);
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'Student';
    }
    
    public  function field()
    {
        return array (  'studentId' =>   array (    0 => 'INT',    1 => 11,    2 => '学生id',  ),  'studentName' =>   array (    0 => 'VARCHAR',    1 => 200,    2 => '姓名',  ),  'studentImg' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '学生头像@image;',  ),  'sex' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '性别@status;0::保密;1::男;2::女',  ),  'birthday' =>   array (    0 => 'DATE',    1 => 0,    2 => '生日',  ),  'gradeId' =>   array (    0 => 'INT',    1 => 11,    2 => '年级@foreign::tbl_grade;',  ),  'school' =>   array (    0 => 'VARCHAR',    1 => 512,    2 => '学校',  ),  'ip' =>   array (    0 => 'VARCHAR',    1 => 15,    2 => 'ip@noload;@hide',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间',  ),  'uid' =>   array (    0 => 'INT',    1 => 11,    2 => '用户@foreign::tbl_user;',  ),);
    }


}